package com.hello.tong.service;

import com.hello.tong.feign.OrderFeignService;
import com.hello.tong.feign.StorageFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author tong-exists
 * @Create 2022/12/30 19:00
 * @Version 1.0
 */
@Service
public class BusinessServiceImpl implements IBusinessService {
    @Autowired
    private StorageFeignService storageService;
    @Autowired
    private OrderFeignService orderService;

    /**
     * 采购
     */
    @Override
    public void purchase(String userId, String commodityCode, int orderCount) {

        storageService.deduct(commodityCode, orderCount);

        orderService.create(userId, commodityCode, orderCount);
    }
}